/*
Dua du lieu tu cau truy van query vao ResultModel
* Chuc nag nhu mot Adapter
 */
package DAO;


import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;



public class Result {
    //Thu hien Getdatatbale
    public ResultsModel GetResult(Connection conn,String query,String []title)
    {
        ResultsModel r=null;
        try {     
            Statement stmt = conn.createStatement();
            ResultSet st = stmt.executeQuery(query);
               r= new ResultsModel();
            r.setResultSet(st,title);
        } catch (SQLException ex) {
            System.out.printf(ex.getMessage());
        }
            return r;
    }
}
